from flask import Flask, request, jsonify, redirect, make_response, render_template

import datetime

app = Flask(__name__)

app.config.from_pyfile("config.py")


@app.route("/home")
def home():
    name1 = "柴进"
    ename = "chai jin"
    age1 = 50
    add = {"city": "北京市", "xianqu": "海淀区", "jiedao": "长安街100号，国家大剧院对面"}
    genders = ["男", "女"]
    username = "段天涯"
    html = "<p> <b>我是危险物品</b> </p>"
    books = [{"title": "天龙八部", "hero": "乔峰"}, {"title": "射雕英雄传", "hero": "郭靖"}, {"title": "侠客行", "hero": "石破天"}]
    return render_template("homelist.html", html=html, name=name1, ename=ename, age=age1, address=add, genders=genders,
                           username=username,
                           books=books)


@app.route("/login")
def login():
    return render_template("login.html")


@app.route("/register")
def register():
    return render_template("register.html")


@app.template_filter("mmax")
def mymax(value):
    return max(value)


if __name__ == '__main__':
    app.run()
